glib2: fix builds by explicitly disabling libelf#28524
glib2: fix builds by explicitly disabling libelf#28524exludai wants to merge 1 commit intoopenwrt:masterfrom
Conversation
|
If this fixes an issue introduces in a previous commit, please add it to Also, how did you test this? |
3fa64f7 to
eb77273
Compare
|
The |
eb77273 to
cae6e0c
Compare
There was a problem hiding this comment.
@exludai I would suggest to add more details into the commit description, so everyone knows why is this change needed.
glib2: fix builds by explicitly disabling libelf
The libelf Meson option defaults to auto. Since commit 71b7b4478906 ("glib2: do not set default meson options"),
glib2 can enable libelf support nondeterministically depending on whether libelf.pc is visible during configure.
On failing builders Meson reports:
Run-time dependency libelf found: YES 0.192
and gresource later fails with:
../gio/gresource-tool.c:34:10: fatal error: libelf.h: No such file or directory
On passing builders we see:
Run-time dependency libelf found: NO (tried pkgconfig and cmake)
So explicitly disable libelf again to restore deterministic builds.
Fixes: 71b7b4478906 ("glib2: do not set default meson options")
Timeline of failing build
From the failing build log, Meson did enable libelf in openwrt-build.log:64738:
Configuring config.py using configuration
Message: Found bash-completion but the .pc file did not set 'completionsdir', fallback to a predefined path
Run-time dependency libelf found: YES 0.192
Compiler for C supports arguments -Wno-implicit-fallthrough: YESLater, the same build fails compiling gresource in openwrt-build.log:75896:
FAILED: gio/gresource.p/gresource-tool.c.o
x86_64-openwrt-linux-musl-gcc ... -o gio/gresource.p/gresource-tool.c.o -c ../gio/gresource-tool.c
../gio/gresource-tool.c:34:10: fatal error: libelf.h: No such file or directory
34 | #include <libelf.h>
| ^~~~~~~~~~
compilation terminated.Only later does elfutils stage the target headers and libelf.pc in openwrt-build.log:88850:
install -d -m0755 /home/openwrt/openwrt/tmp/stage-elfutils/usr/include
cp -fpR /home/openwrt/openwrt/build_dir/target-x86_64_musl/elfutils-0.192/ipkg-install/usr/include/* /home/openwrt/openwrt/tmp/
stage-elfutils/usr/include/
...
cp -fpR /home/openwrt/openwrt/build_dir/target-x86_64_musl/elfutils-0.192/ipkg-install/usr/lib/pkgconfig/libelf.pc /home/openwrt/
openwrt/tmp/stage-elfutils/usr/lib/pkgconfig/cae6e0c to
89c403c
Compare
|
Hi @GeorgeSapkin thank you for the review
added the
randomly hit in ci job Hi @ynezz thank you for the detailed review
took your writings in the commit message |
|
Please bump the PKG_RELEASE by one in the makefile with this commit. |
The libelf Meson option defaults to auto. Since commit 71b7b44 ("glib2: do not set default meson options"), glib2 can enable libelf support nondeterministically depending on whether libelf.pc is visible during configure. On failing builders Meson reports: Run-time dependency libelf found: YES 0.192 and gresource later fails with: ../gio/gresource-tool.c:34:10: fatal error: libelf.h: No such file or directory On passing builders we see: Run-time dependency libelf found: NO (tried pkgconfig and cmake) So explicitly disable libelf again to restore deterministic builds. Fixes: 71b7b44 ("glib2: do not set default meson options") Signed-off-by: Lu Dai <lu.dai@mind.be>
89c403c to
8f39593
Compare
increased the |
glib2 compile randomly failed due to
mechanism is unclear yet. the direct reason is:
1, meson detected dependency libelf (refer to glib2/gio/meson.build rules)
2, but the libelf.h is not in the staging directory
although the mechanism is unclear, here in glib2/makefile something can be fixed.
1, commit
e1d8f4fdisabled the libelf feature2, commit
71b7b44deleted that, to avoid setting default meson optionsthe argument is: libelf feature is not "disabled" by default in glib2 meson options, it is "auto", and "auto" is not equivalent to "disabled". based on the argument, suggest to disable glib2 feature explicitly.
fixes: #23459
📦 Package Details
Maintainer: @neheb @Ansuel @GeorgeSapkin
Description:
🧪 Run Testing Details
✅ Formalities
If your PR contains a patch:
git am(e.g., subject line, commit description, etc.)
We must try to upstream patches to reduce maintenance burden.